//@author A0105495A

//Help class to display any help information
//Singleton protocal
//use generateHelp() method to get a help
#pragma once
#include <string>
#include "TECommonFunctions.h"
#include "OperationType.h"
#include "ConstantList.h"
#include "UserCommand.h"

using StringManipulator::isEqualString;
using TimeManipulator::getRandomNumber;
using std::string;
using namespace CommandConstants;
/*using namespace UserCommandStringFunctions;*/
static const string HELP_ADD = "Format: '(add) event or description\\time\\remind time\\repeat rule\\tags'\r\n"
"'add':function to add new events to record. Each event consists of 5 parts:\r\n"
"  1. description: the exact thing to do, such as 'meet friend'.\r\n"
"           input pattern: not restricted.\r\n"
"  2. time:        the time relevants to the event. It can be a duration or \r\n"
"                  specific time point accurate to date, hour, and minute.  \r\n"
"                  Normally this is be the time that the event should start \r\n"
"                  processing. If time is empty, the event will be record as\r\n"
"                  flexible event. Date must have day, month and year. Hour \r\n"
"                  must be entered before minute. Duration has a time point \r\n"
"                  as starting time and a time point as end time.\r\n"
"           input pattern: input format for time is flexible. Default format\r\n"
"                          for date is dd/mm/yy(yy), which can be changed by\r\n"
"                          function setting/config. Another way to indicate \r\n"
"                          date by using key words like 'today','tmr','this \r\n"
"                          sun', etc. Various ways of indicating time can be\r\n"
"                          used: '6 oclock', '6 o' clock', '6 pm', '6p.m.', \r\n"
"  3. remind time: the exact time users want themselves to be reminded about\r\n"
"                  an event. Date is essential for remind, otherwise remind \r\n"
"                  will not be triggered. If an exact time is not entered by\r\n"
"                  the user, message box for reminder will be pumped at 0am.\r\n"
"           input pattern: the same as the one for exact time.\r\n"
"                          etc. To indicate duration, use 'to', '-' or '~'.\r\n"
"  4. repeat rule: the rule an event is repeated. \r\n"
"           input pattern: use 'every' or 'each' followed by intervals such \r\n"
"                          as some days, weeks or months. 'daily', 'weekly' \r\n"
"                          and 'monthly' are also supported.\r\n"
"  5. tags:        the categories or important features about the event.This\r\n"
"                  component can help sorting and searching the events.\r\n"
"           input pattern: not restricted.\r\n"
"Any single one item of add input can be empty except description. When any \r\n"
"of the input is illegal,it will be recorded as empty. There are two formats\r\n"
"to add. One is flexible, the sequence of event components does not matter. \r\n"
"The other is description\\time\\remind time\\repeat rule\\tags.\r\n"
"p.s. 'add' command equals to 'new', also can be omitted.\r\n";
static const string HELP_DELETE = "Format: 'delete index'(, index, index to index)\r\n"
"'delete' is the function to delete events recorded. Before delete command, there\r\n"
"must be a display command. This is to make sure users know the exact events\r\n"
"at each index. Delete can delete one event or several events. After delete,\r\n"
"indices deleted and indices illegal will be shown separately. \r\n"
"p.s. 'delete' command equals to 'del'.\r\n";
static const string HELP_UNDO = "Format: 'undo x'. x is the positive integer number of commands to cancel. \r\n"
"undo previous command(s). This function cancels the command(s) done but \r\n"
"should not have been done. If x is not given, the program will set it to 1.\r\n"
"After undo, number of undo successfully done will be shown. \r\n";
static const string HELP_SEARCH = "Format: 'search x', where x is the key word of the feature.\r\n"
"search can find events with specific features. These features include all 5 \r\n"
"components of event, and also additional filters marked by 'mark'. Filters \r\n"
"include 'done','not done','missed','not missed','reminded','not reminded', \r\n"
"'favourite' and 'not favourite'. \r\n"
"p.s. 'search' command equals to 'find', 'show','display'(search events with\r\n"
"no feature, the same as 'show')\r\n";
static const string HELP_MODIFY = "Format:'modify indices description\\time\\remind time\\repeat rule\\tags'\r\n"
"'modify' modifies the five components of events at entered indices.'display'\r\n"
"must be done before 'modify'. \r\n"
"After modify, indices modified and indices illegal will be shown separately\r\n"
"p.s. 'modify' command equals to 'change' and 'edit'.\r\n";
static const string HELP_MARK = "Format: 'mark indices filter1\\filter2\\...'\r\n"
"'mark' mark events at entered indices with specific filters such as 'done'.\r\n"
"'mark' can only be done after 'display'. Filters: done,not done,missed,not \r\n"
"missed,reminded,not reminded,favourite,not favourite.\r\n"
"After mark, indices marked and indices illegal will be shown separately. \r\n";
static const string HELP_CLEAR = "Format: 'clear'. It cleans every thing in GUI main text box.\r\n";
static const string HELP_EXIT = "Format: 'exit'. It terminates this software. All changes made will be saved.\r\n"
"p.s. 'exit' command equals to 'quit'.\r\n";
static const string HELP_CONFIG = "Format: 'config'\r\n"
"'config' change the setting of this software to make it more user-friendly.\r\n"
"Guidings for config will be displayed after 'config' entered. Select which \r\n"
"format setting to change and then enter the index of the preferred format. \r\n"
"After config done, user can choose to leave config or to config other parts\r\n"
"p.s. 'config' command equals to 'setting'.\r\n";
static const string HELP_SAVEFILE = "Format: enter 'save' will trigger this function.\r\n"
"'save' will save the changes made to reduce loss caused by unexpected shut down.\r\n";
static const string HELP_DEFAULT = "Format: 'help x' where x belongs to functions below.For more information on\r\n"
"that function, such as 'help add'.\r\n"
"valid fuction calls are listed below:\r\n"
" 'add','new' for adding new events.\r\n"
" 'delete', 'del' for deleting events recorded.\r\n"
" 'change', 'modify', 'edit' for modifying existing events.\r\n"
" 'search', 'find','display','show' to find events with specific features\r\n"
" 'undo' to cancel previous commands\r\n"
" 'setting','config' to change the setting of this software.\r\n"
" 'mark' to mark events with specific filters such as 'done'.\r\n"
" 'exit','quit' to terminate the software.\r\n"
" 'clear' to clear screen.\r\n"
" 'save' to save changes made to record.\r\n";
class Help {
private:
	void operator = (const Help& rightOperand);
	string _content;

public:
	static Help& get();
	string generateHelp(OperationType helpType);
	void triggerEnter();
};

